package com.orm;

import javax.persistence.*;
import javax.persistence.Entity;

/**
 * Created by lirance on 16/4/6.
 */
@Entity
@Table(name = "user", schema = "", catalog = "ServiceRecommendationSystem")
public class UserEntity extends com.orm.Entity{
    private int uId;
    private String ip;
    private String dName;
    private String cName;

    @Id
    @Column(name = "uId", nullable = false, insertable = true, updatable = true)
    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    @Basic
    @Column(name = "ip", nullable = false, insertable = true, updatable = true, length = 255)
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "dName", nullable = true, insertable = true, updatable = true, length = 255)
    public String getdName() {
        return dName;
    }

    public void setdName(String dName) {
        this.dName = dName;
    }

    @Basic
    @Column(name = "CName", nullable = true, insertable = true, updatable = true, length = 255)
    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserEntity that = (UserEntity) o;

        if (uId != that.uId) return false;
        if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false;
        if (dName != null ? !dName.equals(that.dName) : that.dName != null) return false;
        if (cName != null ? !cName.equals(that.cName) : that.cName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = uId;
        result = 31 * result + (ip != null ? ip.hashCode() : 0);
        result = 31 * result + (dName != null ? dName.hashCode() : 0);
        result = 31 * result + (cName != null ? cName.hashCode() : 0);
        return result;
    }
}
